﻿<%@ WebHandler Language="C#" Class="jsonData" %>

using System;
using System.Web;

public class jsonData : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";
        string data = "[{name:\"ants\",age:24},{name:\"lele\",age:23}]";//构建的json数据
       //下面两句是用来测试前台向此页面发出的查询字符
        string querystrname = context.Request.QueryString.GetValues("name")[0];//取查询字符串中namer的值
        string querystage = context.Request.QueryString.GetValues("age")[0];//取查询字符串中age的值
        
        context.Response.Write(data);
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}